import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/login',
    name:'Login',
    component:Login,
    meta:{
      isLogin:false
    }
  },
  {
    path:'/home',
    name:'Home',
    component:()=>import('../views/Home.vue'),
    meta:{
      isLogin:true
    },
    children:[
      {
        path:'/home/stuMan',
        component:()=>import('../views/StuMan.vue')
      },
      {
        path:'/home/classMan',
        component:()=>import('../views/ClassMan.vue')
      },
      {
        path:'/home/techMan',
        component:()=>import('../views/TechMan.vue')
      }
    ]
  },
  {
    path:'/',
    redirect:'/login'
  }
]

const router = new VueRouter({
  routes
})

export default router
